package com.sike.netty.im.client.handler;

import cn.hutool.core.date.DateUtil;
import com.sike.netty.im.client.event.CustomEvent;
import com.sike.netty.im.client.event.EventFactory;
import com.sike.netty.im.client.service.BeanFactory;
import com.sike.netty.im.client.service.ClientService;
import com.sike.netty.im.common.command.JoinGroupResponseCommand;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.util.Scanner;

/**
 * 加入群聊响应 handler
 *
 * @author chenssy
 * @date 2023/09/20
 */
public class JoinGroupResponseHandler extends SimpleChannelInboundHandler<JoinGroupResponseCommand> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, JoinGroupResponseCommand msg) throws Exception {
        System.out.println("[" + DateUtil.now() + "]：系统 >>> 加入群聊成功，群名称为[" + msg.getGroupName() + "]");
        System.out.println("[" + DateUtil.now() + "]：系统 >>> 群成员有:" + String.join(",",msg.getMemberList()));
    }
}
